/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

/**
 * 聚单客官网
 */
import React, { useState } from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import { Tabs } from 'antd';
import KbDelivery from '@/components/_pages/jdk/shield/delivery';
import KbWhiteList from '@/components/_pages/jdk/shield/whiteList';

const Index: React.FC = () => {
  const [activeKey, setActiveKey] = useState<string>('close');
  const tabList = [
    {
      tab: '添加运力屏蔽',
      key: 'delivery',
      child: <KbDelivery show={activeKey === 'delivery'} />,
    },
    {
      tab: '添加白名单',
      key: 'whiteList',
      child: <KbWhiteList show={activeKey === 'whiteList'} />,
    },
  ];

  return (
    <PageContainer>
      <Tabs onChange={setActiveKey}>
        {tabList.map(({ child, ...rest }) => (
          <Tabs.TabPane tab={rest.tab} key={rest.key}>
            {child}
          </Tabs.TabPane>
        ))}
      </Tabs>
    </PageContainer>
  );
};

export default Index;
